package com.chen.controller;

import com.chen.aop.OperLog;
import com.chen.dto.ResponData;
import com.chen.entity.WebUpdateLog;
import com.chen.general.Constans;
import com.chen.general.ModuleType;
import com.chen.general.StateCode;
import com.chen.service.WebUpdateLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;

@RestController
@RequestMapping("api/webUpdateLog")
public class WebUpdateLogController {

    @Autowired
    private WebUpdateLogService webUpdateLogService;


    @OperLog(operModul = ModuleType.SYSTEM, operType = ModuleType.QUERY, operDesc = "查看更新日志")
    @RequestMapping("queryUpdateLog")
    public ResponData queryUpdateLog(String keyword, String sssj) {

        String sssjq = "";
        String sssjz = "";
        if (sssj != null && sssj != "") {
            String[] sssjs = sssj.split(",");
            sssjq = sssjs[0];
            sssjz = sssjs[1];
        }
        List<HashMap> webUpdateLogs = this.webUpdateLogService.selectAllUpdateLog(keyword, sssjq, sssjz);
        return new ResponData(Constans.SUCCESS_MES, StateCode.SUCCEED_CODE, webUpdateLogs);
    }


}
